package com.xm.rsi.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xm.rsi.model.dto.audit.AuditAddRequest;
import com.xm.rsi.model.dto.filedata.FileDataAddRequest;
import com.xm.rsi.model.dto.filedata.FileDataQueryRequest;
import com.xm.rsi.model.dto.filedata.FileDataUpdateRequest;
import com.xm.rsi.model.entity.FileData;
import com.xm.rsi.model.vo.FileDataCountVO;
import com.xm.rsi.model.vo.FileDataVO;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

/**
* @author xmm
* @description 针对表【file_data】的数据库操作Service
* @createDate 2023-10-02 18:47:18
*/
public interface FileDataService extends IService<FileData> {
    String getUrl(InputStream fileInputStream, String fileName) throws Exception;

    void delFile(String fileName);

    Long addOne(FileDataAddRequest fileDataAddRequest, InputStream fileInputStream, String fileName, HttpServletRequest request);

    Boolean updOne(FileDataUpdateRequest fileDataUpdateRequest, InputStream fileInputStream, String fileName, HttpServletRequest request);
    
    FileDataVO getFileDataVO(FileData fileData);
    
    QueryWrapper<FileData> getQueryWrapper(FileDataQueryRequest fileDataQueryRequest);
    
    Page<FileDataVO> getFileDataPageVo(Page<FileData> fileDataPage);

    Boolean audit(AuditAddRequest auditAddRequest, HttpServletRequest request);
    
    Boolean isOwn(Long userId, HttpServletRequest request);

    Page<FileData> getPage(Page<Object> objectPage, QueryWrapper<FileData> queryWrapper);

    FileDataCountVO countAll();
    
    Long countOne(String col, String str);
    
    FileData max_minOne(String col, String ai);

    List<FileDataVO> pointSer(Map<String, String> map);
    
    List<FileDataVO> rectSer(Map<String, String> map);

    Page<FileDataVO> AllSer(long current, long pageSize, Map<String, String> map);

    List<FileDataVO> getFileDataVOList(List<FileData> fileDataList);

    List<FileData> uploadDirectory(File tempFile, Long userId);

    void delFileDataList(List<FileData> fileDataList);
}
